﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UIFramework.Editor
{
    public static class UIShotNameMap
    {
        /*
         组件简称映射
             */

        public static Dictionary<string, string> ComponentShortNames = new Dictionary<string, string>();    // 组件简写//

        static UIShotNameMap()
        {
            ShortNameMapping();
        }

        public static bool TryGetValue(string fullName, out string shotName)
        {
            return ComponentShortNames.TryGetValue(fullName, out shotName);
        }

        //简称映射
        static void ShortNameMapping()
        {
            ComponentShortNames.Add("Image", "Img");
            ComponentShortNames.Add("RawImage", "RImg");
            ComponentShortNames.Add("InputField", "Ipt");
            ComponentShortNames.Add("Text", "Txt");
            ComponentShortNames.Add("TMPro.TextMeshProUGUI", "Txt");
            ComponentShortNames.Add("UIText", "Utxt");
            ComponentShortNames.Add("Slider", "Sld");
            ComponentShortNames.Add("GameObject", "Gobj");
            ComponentShortNames.Add("Toggle", "Tog");
            ComponentShortNames.Add("ScrollRect", "ScrR");
            ComponentShortNames.Add("Dropdown", "Drpd");
            ComponentShortNames.Add("Scrollbar", "Scrb");
            ComponentShortNames.Add("GridLayoutGroup", "GrdL");
            ComponentShortNames.Add("HorizontalLayoutGroup", "HrnL");
            ComponentShortNames.Add("VerticalLayoutGroup", "VrtL");
            ComponentShortNames.Add("ScrollView", "ScrV");
            ComponentShortNames.Add("UIButton", "Btn");
            ComponentShortNames.Add("CanvasGroup", "CvsGrp");
        }
    }
}
